<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>年龄层判断</title>
</head>

<body>
    <script>
        var age = 19;
        if (age >= 18) {
            alert("adult");
        } else if (age >= 6) {
            alert("teenager");
        } else {
            alert("kid");
        }
        if (age) {
            document.write("Hello");
        } else {
            document.write("BYE");
        }
    </script>
</body>

</html>